package com.shujia.flink.source

import org.apache.flink.streaming.api.scala._

object Demo2FileSource {
  def main(args: Array[String]): Unit = {
    //创建flink环境
    val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment

    /**
     * 2、基于文件构建DataStream
     */
    //有界流
    val studentDS: DataStream[String] = env.readTextFile("data/students.txt")

    studentDS.print()

    env.execute()

  }
}
